package com.ruoyi.system.domain.dao;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.eic.framework.core.annotation.UpdateTime;
import com.eic.framework.core.annotation.UpdateUser;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serializable;
import java.util.Date;

/**
 * 用户密码信息对象 sys_user_passwd
 *
 * @author 尹国春
 * @date 2022-08-01
 */
@ApiModel("用户密码信息对象")
@TableName("sys_user_passwd")
public class SysUserPasswd implements Serializable
{
    private static final long serialVersionUID = 1L;

    /**  */
    @ApiModelProperty(value = "主键ID")
    @TableId(value = "user_id",type = IdType.ASSIGN_ID)
    private String userId;

    /** 密码 */
    @Excel(name = "密码")
    @ApiModelProperty(value = "密码")
    @TableField("password")
    private String password;

    /** 最近密码修改时间 */
    @Excel(name = "最近密码修改时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "最近密码修改时间")
    @TableField("passwd_modify_date")
    private Date passwdModifyDate;

    /** 最后登录IP */
    @Excel(name = "最后登录IP")
    @ApiModelProperty(value = "最后登录IP")
    @TableField("login_ip")
    private String loginIp;

    /** 最后登录时间 */
    @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "最后登录时间")
    @TableField("login_date")
    private Date loginDate;

    /** 更新者 */
    @ApiModelProperty(hidden = true)
    @TableField("update_by")
    @UpdateUser
    private String updateBy;

    /** 更新时间 */
    @ApiModelProperty(hidden = true)
    @TableField("update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @UpdateTime
    private Date updateTime;

    public SysUserPasswd setUserId(String userId)
    {
        this.userId = userId;
        return this;
    }

    public String getUserId()
    {
        return userId;
    }
    public SysUserPasswd setPassword(String password)
    {
        this.password = password;
        return this;
    }

    public String getPassword()
    {
        return password;
    }
    public SysUserPasswd setPasswdModifyDate(Date passwdModifyDate)
    {
        this.passwdModifyDate = passwdModifyDate;
        return this;
    }

    public Date getPasswdModifyDate()
    {
        return passwdModifyDate;
    }
    public SysUserPasswd setLoginIp(String loginIp)
    {
        this.loginIp = loginIp;
        return this;
    }

    public String getLoginIp()
    {
        return loginIp;
    }
    public SysUserPasswd setLoginDate(Date loginDate)
    {
        this.loginDate = loginDate;
        return this;
    }

    public Date getLoginDate()
    {
        return loginDate;
    }
    public SysUserPasswd setUpdateBy(String updateBy)
    {
        this.updateBy = updateBy;
        return this;
    }

    public String getUpdateBy()
    {
        return updateBy;
    }
    public SysUserPasswd setUpdateTime(Date updateTime)
    {
        this.updateTime = updateTime;
        return this;
    }

    public Date getUpdateTime()
    {
        return updateTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.SHORT_PREFIX_STYLE)
                .append("userId", getUserId())
                .append("password", getPassword())
                .append("passwdModifyDate", getPasswdModifyDate())
                .append("loginIp", getLoginIp())
                .append("loginDate", getLoginDate())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
